<html>
<head>
<title>unit tests coverage</title>
<link rel ="stylesheet" type="text/css" href="../../../../style.css" title="Style">
</head>
<body>
<span class="title">Coverage report</span>
<p>
  <table cellspacing="0" cellpadding="0" class="report">
  <tr class="report">
    <th class="report">&nbsp;</th>
    <th class="report">%line</th>
    <th class="report">%branch</th>
  </tr>
  <tr class="report">
    <td class="reportText"><span class="text">org.apache.torque.util.BasePeer$5</span></td>
    <td class="reportValue"><table class="percentGraph" cellpadding="0" cellspacing="0" align="right"><tr><td><span class="text">0%&nbsp;</span></td><td><table class="percentGraph" cellpadding="0" cellspacing="0"><tr><td class="percentCovered" width="0"></td><td class="percentUnCovered" width="100.0"></td></tr></table></td></tr></table></td>
    <td class="reportValue"><table class="percentGraph" cellpadding="0" cellspacing="0" align="right"><tr><td><span class="text">0%&nbsp;</span></td><td><table class="percentGraph" cellpadding="0" cellspacing="0"><tr><td class="percentCovered" width="0"></td><td class="percentUnCovered" width="100.0"></td></tr></table></td></tr></table></td>
  </tr>
  </table>
  <p>
  <table cellspacing="0" cellpadding="0" class="src">
    <tr>
      <td class="numLine">&nbsp;1</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> org.apache.torque.util;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;2</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;3</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">/*</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;4</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;5</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * or more contributor license agreements.  See the NOTICE file</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;6</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * distributed with this work for additional information</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;7</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * regarding copyright ownership.  The ASF licenses this file</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;8</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * to you under the Apache License, Version 2.0 (the</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;9</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * "License"); you may not use this file except in compliance</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;10</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * with the License.  You may obtain a copy of the License at</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;11</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;12</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;13</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;14</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * Unless required by applicable law or agreed to in writing,</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;15</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * software distributed under the License is distributed on an</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;16</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;17</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * KIND, either express or implied.  See the License for the</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;18</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * specific language governing permissions and limitations</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;19</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * under the License.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;20</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;21</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;22</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.Serializable;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;23</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.sql.Connection;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;24</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.sql.PreparedStatement;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;25</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.sql.SQLException;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;26</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.sql.Statement;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;27</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.ArrayList;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;28</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collections;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;29</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.HashSet;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;30</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Iterator;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;31</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.List;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;32</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;33</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Set;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;34</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;35</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.commons.lang.StringUtils;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;36</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.commons.logging.Log;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;37</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.commons.logging.LogFactory;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;38</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.Database;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;39</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.Torque;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;40</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.TorqueException;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;41</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.adapter.DB;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;42</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.map.ColumnMap;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;43</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.map.DatabaseMap;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;44</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.map.MapBuilder;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;45</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.map.TableMap;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;46</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.oid.IdGenerator;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;47</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.om.NumberKey;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;48</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.om.ObjectKey;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;49</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.om.SimpleKey;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;50</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.apache.torque.om.StringKey;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;51</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;52</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.Column;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;53</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.DataSet;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;54</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.DataSetException;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;55</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.KeyDef;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;56</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.QueryDataSet;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;57</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.Record;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;58</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.Schema;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;59</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> com.workingdogs.village.TableDataSet;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;60</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;61</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;62</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * This is the base class for all Peer classes in the system.  Peer</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;63</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * classes are responsible for isolating all of the database access</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;64</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * for a specific business object.  They execute all of the SQL</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;65</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * against the database.  Over time this class has grown to include</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;66</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * utility methods which ease execution of cross-database queries and</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;67</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * the implementation of concrete Peers.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;68</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;69</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author &#60;a href="mailto:frank.kim@clearink.com"&#62;Frank Y. Kim&#60;/a&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;70</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author &#60;a href="mailto:jmcnally@collab.net"&#62;John D. McNally&#60;/a&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;71</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author &#60;a href="mailto:bmclaugh@algx.net"&#62;Brett McLaughlin&#60;/a&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;72</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author &#60;a href="mailto:stephenh@chase3000.com"&#62;Stephen Haberman&#60;/a&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;73</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author &#60;a href="mailto:mpoeschl@marmot.at"&#62;Martin Poeschl&#60;/a&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;74</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author &#60;a href="mailto:vido@ldh.org"&#62;Augustin Vidovic&#60;/a&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;75</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author &#60;a href="mailto:hps@intermeta.de"&#62;Henning P. Schmiedehausen&#60;/a&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;76</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> * @version $Id: BasePeer.java 591648 2007-11-03 16:34:00Z tfischer $</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;77</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;78</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">abstract</span> <span class="keyword">class</span> BasePeer</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;79</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        implements Serializable</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;80</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;{</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;81</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">* Constant criteria key to reference ORDER BY columns. */</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;82</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> String ORDER_BY = <span class="string">"ORDER BY"</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;83</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;84</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;85</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Constant criteria key to remove Case Information from</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;86</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * search/ordering criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;87</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;88</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> String IGNORE_CASE = <span class="string">"IgNOrE cAsE"</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;89</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;90</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">* Classes that implement this class should override this value. */</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;91</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">final</span> String TABLE_NAME = <span class="string">"TABLE_NAME"</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;92</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;93</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">* the log */</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;94</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> <span class="keyword">static</span> <span class="keyword">final</span> Log log = LogFactory.getLog(BasePeer.<span class="keyword">class</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;95</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;96</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">void</span> throwTorqueException(Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;97</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;98</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;99</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (e instanceof TorqueException)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;100</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;101</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> (TorqueException) e;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;102</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;103</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;104</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;105</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;106</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;107</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;108</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;109</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;110</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Sets up a Schema for a table.  This schema is then normally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;111</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * used as the argument for initTableColumns().</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;112</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;113</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param tableName The name of the table.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;114</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A Schema.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;115</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;116</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> Schema initTableSchema(String tableName)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;117</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;118</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> initTableSchema(tableName, Torque.getDefaultDB());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;119</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;120</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;121</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;122</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Sets up a Schema for a table.  This schema is then normally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;123</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * used as the argument for initTableColumns</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;124</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;125</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param tableName The propery name for the database in the</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;126</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * configuration file.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;127</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dbName The name of the database.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;128</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A Schema.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;129</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;130</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> Schema initTableSchema(String tableName, String dbName)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;131</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;132</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Schema schema = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;133</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;134</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;135</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;136</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;137</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Torque.getConnection(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;138</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            schema = <span class="keyword">new</span> Schema().schema(con, tableName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;139</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;140</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;141</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;142</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            log.error(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;143</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> Error(<span class="string">"Error in BasePeer.initTableSchema("</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;144</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    + tableName</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;145</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    + <span class="string">"): "</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;146</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    + e.getMessage());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;147</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;148</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;149</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;150</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Torque.closeConnection(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;151</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;152</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> schema;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;153</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;154</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;155</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;156</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Creates a Column array for a table based on its Schema.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;157</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;158</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param schema A Schema object.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;159</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A Column[].</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;160</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;161</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> Column[] initTableColumns(Schema schema)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;162</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;163</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Column[] columns = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;164</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;165</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;166</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">int</span> numberOfColumns = schema.numberOfColumns();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;167</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            columns = <span class="keyword">new</span> Column[numberOfColumns];</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;168</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &#60; numberOfColumns; i++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;169</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;170</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                columns[i] = schema.column(i + 1);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;171</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;172</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;173</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;174</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;175</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            log.error(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;176</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> Error(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;177</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="string">"Error in BasePeer.initTableColumns(): "</span> + e.getMessage());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;178</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;179</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> columns;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;180</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;181</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;182</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;183</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Convenience method to create a String array of column names.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;184</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;185</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param columns A Column[].</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;186</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A String[].</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;187</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;188</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> String[] initColumnNames(Column[] columns)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;189</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;190</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String[] columnNames = <span class="keyword">new</span> String[columns.length];</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;191</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &#60; columns.length; i++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;192</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;193</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            columnNames[i] = columns[i].name().toUpperCase();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;194</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;195</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> columnNames;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;196</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;197</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;198</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;199</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Convenience method to create a String array of criteria keys.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;200</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;201</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param tableName Name of table.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;202</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param columnNames A String[].</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;203</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A String[].</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;204</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;205</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> String[] initCriteriaKeys(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;206</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String tableName,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;207</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String[] columnNames)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;208</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;209</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String[] keys = <span class="keyword">new</span> String[columnNames.length];</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;210</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &#60; columnNames.length; i++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;211</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;212</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            keys[i] = tableName + <span class="string">"."</span> + columnNames[i].toUpperCase();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;213</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;214</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> keys;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;215</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;216</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;217</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;218</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Convenience method that uses straight JDBC to delete multiple</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;219</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * rows.  Village throws an Exception when multiple rows are</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;220</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * deleted.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;221</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;222</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;223</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param table The table to delete records from.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;224</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param column The column in the where clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;225</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param value The value of the column.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;226</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;227</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;228</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;229</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> deleteAll(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;230</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;231</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String table,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;232</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String column,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;233</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> value)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;234</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;235</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;236</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Statement statement = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;237</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;238</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;239</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            statement = con.createStatement();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;240</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;241</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            StringBuffer query = <span class="keyword">new</span> StringBuffer();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;242</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            query.append(<span class="string">"DELETE FROM "</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;243</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                .append(table)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;244</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                .append(<span class="string">" WHERE "</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;245</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                .append(column)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;246</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                .append(<span class="string">" = "</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;247</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                .append(value);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;248</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;249</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            statement.executeUpdate(query.toString());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;250</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;251</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;252</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;253</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;254</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;255</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;256</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;257</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (statement != <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;258</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;259</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;260</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;261</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    statement.close();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;262</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;263</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;264</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;265</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;266</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;267</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;268</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;269</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;270</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;271</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;272</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Convenience method that uses straight JDBC to delete multiple</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;273</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * rows.  Village throws an Exception when multiple rows are</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;274</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * deleted.  This method attempts to get the default database from</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;275</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * the pool.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;276</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;277</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param table The table to delete records from.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;278</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param column The column in the where clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;279</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param value The value of the column.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;280</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;281</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;282</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;283</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> deleteAll(String table, String column, <span class="keyword">int</span> value)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;284</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;285</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;286</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;287</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;288</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;289</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// Get a connection to the db.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;290</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Torque.getConnection(Torque.getDefaultDB());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;291</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            deleteAll(con, table, column, value);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;292</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;293</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;294</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;295</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Torque.closeConnection(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;296</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;297</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;298</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;299</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;300</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to perform deletes based on values and keys in a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;301</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;302</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;303</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria The criteria to use.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;304</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;305</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;306</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @deprecated This method causes unexpected results when joins are used.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;307</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *              Please use doDelete(Criteria, String).</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;308</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;309</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> doDelete(Criteria criteria) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;310</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;311</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        doDelete(criteria, (String) <span class="keyword">null</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;312</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;313</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;314</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;315</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to perform deletes based on values and keys in a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;316</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;317</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * This method is protected because it may cause ambiguity between</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;318</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * doDelete(Criteria,Connection) and this method. It will be made public</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;319</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * once doDelete(Criteria, Connection) is removed.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;320</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;321</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria The criteria to use.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;322</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param tableName the name of the table to delete records from.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;323</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         If set to null, the name of the table(s) can be extracted from</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;324</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         the criteria, but this can cause unexpected results.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;325</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;326</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;327</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;328</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> <span class="keyword">static</span> <span class="keyword">void</span> doDelete(Criteria criteria, String tableName) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;329</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;330</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;331</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;332</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;333</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Transaction.beginOptional(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;334</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    criteria.getDbName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;335</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    criteria.isUseTransaction());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;336</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            doDelete(criteria, tableName, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;337</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.commit(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;338</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;339</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (TorqueException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;340</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;341</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.safeRollback(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;342</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> e;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;343</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;344</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;345</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;346</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;347</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to perform deletes based on values and keys in a Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;348</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;349</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria The criteria to use.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;350</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;351</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;352</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;353</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @deprecated This method causes unexpected results when joins are used.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;354</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *              Please use doDelete(Criteria, String, Connection).</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;355</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;356</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> doDelete(Criteria criteria, Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;357</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;358</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;359</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        doDelete(criteria, <span class="keyword">null</span>, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;360</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;361</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;362</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;363</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to perform deletes based on values and keys in a Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;364</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;365</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria The criteria to use.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;366</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param tableName the name of the table to delete records from.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;367</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         If set to null, the name of the table(s) can be extracted from</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;368</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         the criteria, but this can cause unexpected results.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;369</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;370</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;371</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;372</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;373</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> doDelete(Criteria criteria, String tableName, Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;374</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;375</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;376</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String dbName = criteria.getDbName();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;377</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">final</span> DatabaseMap dbMap = Torque.getDatabaseMap(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;378</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;379</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// This Callback adds all tables to the Table set which</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;380</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// are referenced from a cascading criteria. As a result, all</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;381</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// data that is referenced through foreign keys will also be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;382</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// deleted.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;383</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        SQLBuilder.TableCallback tc = <span class="keyword">new</span> SQLBuilder.TableCallback() {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;384</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">public</span> <span class="keyword">void</span> process (Set tables, String key, Criteria crit)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;385</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;386</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (crit.isCascade())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;387</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;388</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        <span class="comment">// This steps thru all the columns in the database.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;389</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        TableMap[] tableMaps = dbMap.getTables();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;390</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &#60; tableMaps.length; i++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;391</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;392</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            ColumnMap[] columnMaps = tableMaps[i].getColumns();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;393</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;394</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            <span class="keyword">for</span> (<span class="keyword">int</span> j = 0; j &#60; columnMaps.length; j++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;395</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;396</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                <span class="comment">// Only delete rows where the foreign key is</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;397</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                <span class="comment">// also a primary key.  Other rows need</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;398</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                <span class="comment">// updating, but that is not implemented.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;399</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                <span class="keyword">if</span> (columnMaps[j].isForeignKey()</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;400</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                        &#38;&#38; columnMaps[j].isPrimaryKey()</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;401</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                        &#38;&#38; key.equals(columnMaps[j].getRelatedName()))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;402</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;403</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                    tables.add(tableMaps[i].getName());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;404</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                    crit.add(columnMaps[j].getFullyQualifiedName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;405</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                            crit.getValue(key));</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;406</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;407</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;408</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;409</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;410</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;411</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            };</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;412</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;413</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Set tables;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;414</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (tableName == <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;415</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;416</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            tables = SQLBuilder.getTableSet(criteria, tc);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;417</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;418</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;419</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;420</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            tables = <span class="keyword">new</span> HashSet(1);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;421</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            tables.add(tableName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;422</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;423</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;424</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;425</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;426</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            processTables(criteria, tables, con, <span class="keyword">new</span> ProcessCallback() {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;427</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">public</span> <span class="keyword">void</span> process(String table, String dbName, Record rec)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;428</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        throws Exception</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;429</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;430</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        rec.markToBeDeleted();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;431</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        rec.save();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;432</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;433</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                });</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;434</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;435</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;436</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;437</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;438</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;439</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;440</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;441</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;442</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to perform inserts based on values and keys in a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;443</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;444</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;445</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If the primary key is auto incremented the data in Criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;446</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * will be inserted and the auto increment value will be returned.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;447</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;448</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If the primary key is included in Criteria then that value will</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;449</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * be used to insert the row.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;450</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;451</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If no primary key is included in Criteria then we will try to</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;452</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * figure out the primary key from the database map and insert the</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;453</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * row with the next available id using util.db.IDBroker.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;454</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;455</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If no primary key is defined for the table the values will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;456</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * inserted as specified in Criteria and -1 will be returned.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;457</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;458</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria Object containing values to insert.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;459</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return An Object which is the id of the row that was inserted</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;460</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * (if the table has a primary key) or null (if the table does not</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;461</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * have a primary key).</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;462</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;463</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;464</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;465</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> ObjectKey doInsert(Criteria criteria) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;466</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;467</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;468</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        ObjectKey id = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;469</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;470</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;471</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;472</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Transaction.beginOptional(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;473</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    criteria.getDbName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;474</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    criteria.isUseTransaction());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;475</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            id = doInsert(criteria, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;476</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.commit(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;477</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;478</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (TorqueException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;479</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;480</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.safeRollback(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;481</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> e;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;482</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;483</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;484</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> id;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;485</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;486</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;487</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;488</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to perform inserts based on values and keys in a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;489</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;490</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;491</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If the primary key is auto incremented the data in Criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;492</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * will be inserted and the auto increment value will be returned.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;493</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;494</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If the primary key is included in Criteria then that value will</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;495</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * be used to insert the row.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;496</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;497</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If no primary key is included in Criteria then we will try to</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;498</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * figure out the primary key from the database map and insert the</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;499</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * row with the next available id using util.db.IDBroker.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;500</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;501</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If no primary key is defined for the table the values will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;502</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * inserted as specified in Criteria and null will be returned.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;503</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;504</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria Object containing values to insert.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;505</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;506</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return An Object which is the id of the row that was inserted</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;507</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * (if the table has a primary key) or null (if the table does not</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;508</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * have a primary key).</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;509</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;510</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;511</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;512</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> ObjectKey doInsert(Criteria criteria, Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;513</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;514</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;515</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        SimpleKey id = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;516</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;517</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// Get the table name and method for determining the primary</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;518</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// key value.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;519</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String table = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;520</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Iterator keys = criteria.keySet().iterator();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;521</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (keys.hasNext())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;522</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;523</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            table = criteria.getTableName((String) keys.next());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;524</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;525</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;526</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;527</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(<span class="string">"Database insert attempted without "</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;528</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    + <span class="string">"anything specified to insert"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;529</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;530</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;531</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String dbName = criteria.getDbName();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;532</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Database database = Torque.getDatabase(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;533</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        DatabaseMap dbMap = database.getDatabaseMap();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;534</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        TableMap tableMap = dbMap.getTable(table);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;535</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Object keyInfo = tableMap.getPrimaryKeyMethodInfo();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;536</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        IdGenerator keyGen</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;537</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                = database.getIdGenerator(tableMap.getPrimaryKeyMethod());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;538</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;539</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        ColumnMap pk = getPrimaryKey(criteria);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;540</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;541</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;542</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// before the insert.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;543</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (keyGen != <span class="keyword">null</span> &#38;&#38; keyGen.isPriorToInsert())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;544</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;545</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// pk will be null if there is no primary key defined for the table</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;546</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// we're inserting into.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;547</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (pk != <span class="keyword">null</span> &#38;&#38; !criteria.containsKey(pk.getFullyQual<span <span class="keyword">class</span>="keyword">if</span>iedName()))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;548</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;549</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                id = getId(pk, keyGen, con, keyInfo);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;550</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                criteria.add(pk.getFullyQualifiedName(), id);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;551</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;552</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;553</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;554</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// Use Village to perform the insert.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;555</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        TableDataSet tds = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;556</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;557</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;558</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            String tableName = SQLBuilder.getFullTableName(table, dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;559</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            tds = <span class="keyword">new</span> TableDataSet(con, tableName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;560</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Record rec = tds.addRecord();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;561</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// not the fully qualified name, insertOrUpdateRecord wants to use table as an index...</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;562</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            BasePeer.insertOrUpdateRecord(rec, table, dbName, criteria);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;563</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;564</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (DataSetException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;565</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;566</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;567</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;568</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;569</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;570</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;571</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;572</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (TorqueException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;573</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;574</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;575</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;576</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;577</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;578</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            VillageUtils.close(tds);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;579</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;580</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;581</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// If the primary key column is auto-incremented, get the id</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;582</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// now.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;583</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (keyGen != <span class="keyword">null</span> &#38;&#38; keyGen.isPostInsert())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;584</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;585</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            id = getId(pk, keyGen, con, keyInfo);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;586</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;587</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;588</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> id;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;589</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;590</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;591</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;592</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Create an Id for insertion in the Criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;593</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;594</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param pk ColumnMap for the Primary key</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;595</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param keyGen The Id Generator object</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;596</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con The SQL Connection to run the id generation under</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;597</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param keyInfo KeyInfo Parameter from the Table map</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;598</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;599</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A simple Key representing the new Id value</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;600</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Possible errors get wrapped in here.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;601</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;602</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> SimpleKey getId(ColumnMap pk, IdGenerator keyGen, Connection con, Object keyInfo)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;603</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;604</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;605</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        SimpleKey id = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;606</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;607</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;608</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;609</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (pk != <span class="keyword">null</span> &#38;&#38; keyGen != <span <span class="keyword">class</span>="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;610</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;611</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (pk.getType() instanceof Number)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;612</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;613</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    id = <span class="keyword">new</span> NumberKey(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;614</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            keyGen.getIdAsBigDecimal(con, keyInfo));</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;615</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;616</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;617</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;618</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    id = <span class="keyword">new</span> StringKey(keyGen.getIdAsString(con, keyInfo));</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;619</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;620</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;621</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;622</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;623</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;624</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;625</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;626</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> id;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;627</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;628</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;629</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;630</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Grouping of code used in both doInsert() and doUpdate()</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;631</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * methods.  Sets up a Record for saving.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;632</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;633</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param rec A Record.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;634</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param table Name of table.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;635</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;636</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;637</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;638</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;639</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">void</span> insertOrUpdateRecord(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;640</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Record rec,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;641</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String table,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;642</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String dbName,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;643</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Criteria criteria)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;644</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;645</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;646</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        DatabaseMap dbMap = Torque.getDatabaseMap(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;647</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;648</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        ColumnMap[] columnMaps = dbMap.getTable(table).getColumns();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;649</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> shouldSave = false;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;650</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> j = 0; j &#60; columnMaps.length; j++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;651</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;652</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            ColumnMap colMap = columnMaps[j];</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;653</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            String colName = colMap.getColumnName();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;654</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            String key = <span class="keyword">new</span> StringBuffer(colMap.getTableName())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;655</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    .append('.')</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;656</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    .append(colName)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;657</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    .toString();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;658</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (criteria.containsKey(key))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;659</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;660</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;661</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;662</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    VillageUtils.setVillageValue(criteria, key, rec, colName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;663</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    shouldSave = <span class="keyword">true</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;664</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;665</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;666</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;667</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;668</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;669</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;670</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;671</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;672</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (shouldSave)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;673</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;674</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;675</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;676</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                rec.save();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;677</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;678</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;679</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;680</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;681</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;682</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;683</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;684</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;685</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(<span class="string">"No changes to save"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;686</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;687</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;688</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;689</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;690</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to create an SQL query for display only based on values in a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;691</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;692</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;693</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;694</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the SQL query for display</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;695</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @exception TorqueException Trouble creating the query string.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;696</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;697</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">static</span> String createQueryDisplayString(Criteria criteria)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;698</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;699</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;700</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> createQuery(criteria).toString();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;701</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;702</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;703</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;704</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to create an SQL query for actual execution based on values in a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;705</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;706</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;707</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;708</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the SQL query for actual execution</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;709</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @exception TorqueException Trouble creating the query string.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;710</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;711</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> String createQueryString(Criteria criteria)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;712</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;713</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;714</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Query query = createQuery(criteria);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;715</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> query.toString();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;716</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;717</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;718</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;719</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method to create an SQL query based on values in a Criteria.  Note that</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;720</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * final manipulation of the limit and offset are performed when the query</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;721</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * is actually executed.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;722</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;723</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;724</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the sql query</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;725</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @exception TorqueException Trouble creating the query string.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;726</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;727</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">static</span> Query createQuery(Criteria criteria)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;728</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;729</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;730</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> SQLBuilder.buildQueryClause(criteria, <span class="keyword">null</span>, <span class="keyword">new</span> SQLBuilder.QueryCallback() {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;731</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">public</span> String process(Criteria.Criterion criterion, List params)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;732</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;733</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">return</span> criterion.toString();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;734</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;735</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            });</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;736</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;737</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;738</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;739</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns all results.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;740</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;741</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;742</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;743</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;744</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;745</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;746</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List doSelect(Criteria criteria) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;747</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;748</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;749</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List results = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;750</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;751</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;752</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;753</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Transaction.beginOptional(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;754</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    criteria.getDbName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;755</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    criteria.isUseTransaction());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;756</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            results = doSelect(criteria, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;757</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.commit(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;758</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;759</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (TorqueException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;760</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;761</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.safeRollback(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;762</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> e;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;763</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;764</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> results;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;765</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;766</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;767</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;768</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns all results.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;769</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;770</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;771</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;772</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;773</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;774</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;775</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;776</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List doSelect(Criteria criteria, Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;777</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;778</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;779</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Query query = createQuery(criteria);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;780</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        DB dbadapter = Torque.getDB(criteria.getDbName());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;781</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;782</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// Call Village depending on the capabilities of the DB</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;783</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> executeQuery(query.toString(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;784</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                dbadapter.supportsNativeOffset() ? 0 : criteria.getOffset(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;785</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                dbadapter.supportsNativeLimit() ? -1 : criteria.getLimit(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;786</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                criteria.isSingleRecord(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;787</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;788</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;789</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;790</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;791</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Utility method which executes a given sql statement.  This</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;792</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * method should be used for select statements only.  Use</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;793</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * executeStatement for update, insert, and delete operations.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;794</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;795</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param queryString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;796</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;797</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;798</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;799</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;800</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List executeQuery(String queryString) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;801</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;802</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> executeQuery(queryString, Torque.getDefaultDB(), false);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;803</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;804</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;805</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;806</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Utility method which executes a given sql statement.  This</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;807</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * method should be used for select statements only.  Use</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;808</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * executeStatement for update, insert, and delete operations.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;809</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;810</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param queryString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;811</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dbName The database to connect to.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;812</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;813</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;814</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;815</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;816</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List executeQuery(String queryString, String dbName)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;817</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;818</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;819</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> executeQuery(queryString, dbName, false);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;820</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;821</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;822</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;823</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method for performing a SELECT.  Returns all results.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;824</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;825</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param queryString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;826</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dbName The database to connect to.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;827</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param singleRecord Whether or not we want to select only a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;828</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * single record.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;829</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;830</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;831</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;832</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;833</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List executeQuery(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;834</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String queryString,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;835</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String dbName,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;836</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> singleRecord)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;837</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;838</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;839</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> executeQuery(queryString, 0, -1, dbName, singleRecord);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;840</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;841</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;842</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;843</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method for performing a SELECT.  Returns all results.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;844</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;845</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param queryString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;846</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param singleRecord Whether or not we want to select only a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;847</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * single record.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;848</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;849</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;850</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;851</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;852</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;853</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List executeQuery(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;854</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String queryString,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;855</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> singleRecord,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;856</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;857</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;858</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;859</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> executeQuery(queryString, 0, -1, singleRecord, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;860</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;861</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;862</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;863</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method for performing a SELECT.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;864</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;865</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param queryString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;866</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param start The first row to return.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;867</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param numberOfResults The number of rows to return.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;868</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dbName The database to connect to.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;869</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param singleRecord Whether or not we want to select only a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;870</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * single record.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;871</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;872</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;873</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;874</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;875</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List executeQuery(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;876</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String queryString,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;877</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> start,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;878</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> numberOfResults,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;879</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String dbName,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;880</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> singleRecord)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;881</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;882</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;883</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;884</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List results = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;885</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;886</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;887</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Torque.getConnection(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;888</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// execute the query</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;889</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            results = executeQuery(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;890</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    queryString,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;891</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    start,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;892</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    numberOfResults,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;893</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    singleRecord,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;894</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;895</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;896</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;897</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;898</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Torque.closeConnection(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;899</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;900</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> results;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;901</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;902</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;903</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;904</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method for performing a SELECT.  Returns all results.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;905</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;906</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param queryString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;907</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param start The first row to return.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;908</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param numberOfResults The number of rows to return.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;909</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param singleRecord Whether or not we want to select only a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;910</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * single record.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;911</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;912</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;913</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;914</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;915</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;916</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List executeQuery(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;917</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String queryString,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;918</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> start,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;919</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> numberOfResults,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;920</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> singleRecord,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;921</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;922</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;923</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;924</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        QueryDataSet qds = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;925</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List results = Collections.EMPTY_LIST;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;926</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;927</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;928</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// execute the query</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;929</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">long</span> startTime = System.currentTimeMillis();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;930</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            qds = <span class="keyword">new</span> QueryDataSet(con, queryString);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;931</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (log.isDebugEnabled())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;932</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;933</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                log.debug(<span class="string">"Elapsed time="</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;934</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        + (System.currentTimeMillis() - startTime) + <span class="string">" ms"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;935</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;936</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            results = getSelectResults(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;937</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    qds, start, numberOfResults, singleRecord);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;938</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;939</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (DataSetException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;940</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;941</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;942</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;943</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;944</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;945</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;946</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;947</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;948</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;949</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            VillageUtils.close(qds);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;950</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;951</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> results;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;952</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;953</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;954</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;955</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns all records in a QueryDataSet as a List of Record</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;956</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * objects.  Used for functionality like util.LargeSelect.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;957</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;958</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #getSelectResults(QueryDataSet, int, int, boolean)</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;959</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param qds the QueryDataSet</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;960</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a List of Record objects</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;961</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;962</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;963</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;964</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List getSelectResults(QueryDataSet qds)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;965</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;966</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;967</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> getSelectResults(qds, 0, -1, false);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;968</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;969</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;970</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;971</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns all records in a QueryDataSet as a List of Record</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;972</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * objects.  Used for functionality like util.LargeSelect.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;973</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;974</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #getSelectResults(QueryDataSet, int, int, boolean)</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;975</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param qds the QueryDataSet</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;976</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param singleRecord</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;977</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a List of Record objects</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;978</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;979</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;980</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;981</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List getSelectResults(QueryDataSet qds, <span class="keyword">boolean</span> singleRecord)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;982</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;983</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;984</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> getSelectResults(qds, 0, -1, singleRecord);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;985</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;986</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;987</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;988</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns numberOfResults records in a QueryDataSet as a List</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;989</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * of Record objects.  Starting at record 0.  Used for</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;990</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * functionality like util.LargeSelect.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;991</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;992</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #getSelectResults(QueryDataSet, int, int, boolean)</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;993</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param qds the QueryDataSet</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;994</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param numberOfResults</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;995</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param singleRecord</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;996</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a List of Record objects</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;997</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;998</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;999</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1000</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List getSelectResults(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1001</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        QueryDataSet qds,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1002</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> numberOfResults,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1003</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> singleRecord)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1004</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1005</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1006</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List results = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1007</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (numberOfResults != 0)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1008</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1009</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            results = getSelectResults(qds, 0, numberOfResults, singleRecord);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1010</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1011</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> results;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1012</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1013</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1014</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1015</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Returns numberOfResults records in a QueryDataSet as a List</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1016</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * of Record objects.  Starting at record start.  Used for</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1017</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * functionality like util.LargeSelect.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1018</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1019</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param qds The &#60;code&#62;QueryDataSet&#60;/code&#62; to extract results</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1020</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * from.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1021</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param start The index from which to start retrieving</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1022</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;code&#62;Record&#60;/code&#62; objects from the data set.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1023</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param numberOfResults The number of results to return (or</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1024</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;code&#62; -1&#60;/code&#62; for all results).</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1025</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param singleRecord Whether or not we want to select only a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1026</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * single record.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1027</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A &#60;code&#62;List&#60;/code&#62; of &#60;code&#62;Record&#60;/code&#62; objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1028</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @exception TorqueException If any &#60;code&#62;Exception&#60;/code&#62; occurs.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1029</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1030</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List getSelectResults(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1031</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        QueryDataSet qds,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1032</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> start,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1033</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> numberOfResults,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1034</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> singleRecord)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1035</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1036</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1037</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List results = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1038</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1039</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1040</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (numberOfResults &#60; 0)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1041</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1042</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                results = <span class="keyword">new</span> ArrayList();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1043</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                qds.fetchRecords();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1044</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1045</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1046</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1047</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                results = <span class="keyword">new</span> ArrayList(numberOfResults);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1048</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                qds.fetchRecords(start, numberOfResults);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1049</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1050</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1051</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">int</span> startRecord = 0;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1052</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1053</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">//Offset the correct number of records</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1054</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (start &#62; 0 &#38;&#38; numberOfResults &#60;= 0)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1055</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1056</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                startRecord = start;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1057</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1058</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1059</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// Return a List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1060</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (<span class="keyword">int</span> i = startRecord; i &#60; qds.size(); i++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1061</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1062</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                Record rec = qds.getRecord(i);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1063</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                results.add(rec);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1064</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1065</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1066</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (results.size() &#62; 1 &#38;&#38; singleRecord)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1067</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1068</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                handleMultipleRecords(qds);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1069</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1070</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1071</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1072</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1073</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1074</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1075</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> results;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1076</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1077</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1078</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1079</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Helper method which returns the primary key contained</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1080</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * in the given Criteria object.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1081</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1082</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1083</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return ColumnMap if the Criteria object contains a primary</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1084</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *          key, or null if it doesn't.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1085</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1086</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1087</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1088</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> ColumnMap getPrimaryKey(Criteria criteria)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1089</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1090</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1091</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// Assume all the keys are for the same table.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1092</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String key = (String) criteria.keys().nextElement();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1093</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1094</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String table = criteria.getTableName(key);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1095</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        ColumnMap pk = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1096</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1097</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (!table.equals(<span class="string">""</span>))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1098</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1099</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            DatabaseMap dbMap = Torque.getDatabaseMap(criteria.getDbName());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1100</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (dbMap == <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1101</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1102</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(<span class="string">"dbMap is null"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1103</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1104</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (dbMap.getTable(table) == <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1105</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1106</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(<span class="string">"dbMap.getTable() is null"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1107</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1108</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1109</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            ColumnMap[] columns = dbMap.getTable(table).getColumns();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1110</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1111</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &#60; columns.length; i++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1112</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1113</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (columns[i].isPrimaryKey())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1114</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1115</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    pk = columns[i];</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1116</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">break</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1117</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1118</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1119</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1120</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> pk;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1121</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1122</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1123</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1124</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Convenience method used to update rows in the DB.  Checks if a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1125</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;i&#62;single&#60;/i&#62; int primary key is specified in the Criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1126</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * object and uses it to perform the udpate.  If no primary key is</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1127</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * specified an Exception will be thrown.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1128</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1129</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Use this method for performing an update of the kind:</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1130</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1131</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * "WHERE primary_key_id = an int"</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1132</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1133</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * To perform an update with non-primary key fields in the WHERE</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1134</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * clause use doUpdate(criteria, criteria).</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1135</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1136</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param updateValues A Criteria object containing values used in</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1137</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *        set clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1138</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1139</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1140</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1141</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> doUpdate(Criteria updateValues) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1142</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1143</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1144</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1145</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1146</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Transaction.beginOptional(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1147</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    updateValues.getDbName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1148</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    updateValues.isUseTransaction());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1149</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            doUpdate(updateValues, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1150</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.commit(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1151</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1152</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (TorqueException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1153</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1154</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.safeRollback(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1155</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> e;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1156</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1157</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1158</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1159</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1160</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Convenience method used to update rows in the DB.  Checks if a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1161</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;i&#62;single&#60;/i&#62; int primary key is specified in the Criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1162</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * object and uses it to perform the udpate.  If no primary key is</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1163</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * specified an Exception will be thrown.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1164</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1165</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Use this method for performing an update of the kind:</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1166</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1167</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * "WHERE primary_key_id = an int"</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1168</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1169</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * To perform an update with non-primary key fields in the WHERE</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1170</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * clause use doUpdate(criteria, criteria).</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1171</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1172</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param updateValues A Criteria object containing values used in</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1173</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * set clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1174</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1175</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1176</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1177</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1178</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> doUpdate(Criteria updateValues, Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1179</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1180</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1181</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        ColumnMap pk = getPrimaryKey(updateValues);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1182</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Criteria selectCriteria = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1183</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1184</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (pk != <span class="keyword">null</span> &#38;&#38; updateValues.containsKey(pk.getFullyQual<span <span class="keyword">class</span>="keyword">if</span>iedName()))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1185</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1186</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            selectCriteria = <span class="keyword">new</span> Criteria(2);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1187</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            selectCriteria.put(pk.getFullyQualifiedName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1188</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                updateValues.remove(pk.getFullyQualifiedName()));</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1189</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1190</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1191</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1192</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(<span class="string">"No PK specified for database update"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1193</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1194</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1195</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        doUpdate(selectCriteria, updateValues, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1196</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1197</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1198</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1199</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method used to update rows in the DB.  Rows are selected based</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1200</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * on selectCriteria and updated using values in updateValues.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1201</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1202</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Use this method for performing an update of the kind:</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1203</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1204</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * WHERE some_column = some value AND could_have_another_column =</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1205</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * another value AND so on...</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1206</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1207</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param selectCriteria A Criteria object containing values used in where</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1208</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *        clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1209</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param updateValues A Criteria object containing values used in set</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1210</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *        clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1211</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1212</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1213</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1214</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> doUpdate(Criteria selectCriteria, Criteria updateValues)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1215</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1216</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1217</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1218</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1219</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1220</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Transaction.beginOptional(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1221</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    selectCriteria.getDbName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1222</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    updateValues.isUseTransaction());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1223</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            doUpdate(selectCriteria, updateValues, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1224</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.commit(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1225</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1226</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (TorqueException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1227</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1228</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Transaction.safeRollback(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1229</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> e;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1230</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1231</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1232</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1233</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1234</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Method used to update rows in the DB.  Rows are selected based</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1235</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * on criteria and updated using values in updateValues.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1236</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1237</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Use this method for performing an update of the kind:</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1238</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * &#60;p&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1239</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * WHERE some_column = some value AND could_have_another_column =</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1240</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * another value AND so on.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1241</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1242</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria A Criteria object containing values used in where</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1243</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *        clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1244</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param updateValues A Criteria object containing values used in set</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1245</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *        clause.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1246</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1247</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1248</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1249</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1250</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> doUpdate(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1251</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Criteria criteria,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1252</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">final</span> Criteria updateValues,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1253</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1254</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1255</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1256</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Set tables = SQLBuilder.getTableSet(criteria, <span class="keyword">null</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1257</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1258</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1259</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1260</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            processTables(criteria, tables, con, <span class="keyword">new</span> ProcessCallback() {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1261</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">public</span> <span class="keyword">void</span> process (String table, String dbName, Record rec)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1262</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        throws Exception</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1263</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1264</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        <span class="comment">// Callback must be called with table name without Schema!</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1265</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        BasePeer.insertOrUpdateRecord(rec, table, dbName, updateValues);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1266</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1267</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                });</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1268</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1269</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (Exception e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1270</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1271</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1272</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1273</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1274</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1275</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1276</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Utility method which executes a given sql statement.  This</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1277</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * method should be used for update, insert, and delete</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1278</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * statements.  Use executeQuery() for selects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1279</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1280</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param statementString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1281</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return The number of rows affected.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1282</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1283</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1284</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1285</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">int</span> executeStatement(String statementString) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1286</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1287</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> executeStatement(statementString, Torque.getDefaultDB());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1288</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1289</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1290</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1291</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Utility method which executes a given sql statement.  This</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1292</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * method should be used for update, insert, and delete</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1293</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * statements.  Use executeQuery() for selects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1294</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1295</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param statementString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1296</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dbName Name of database to connect to.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1297</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return The number of rows affected.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1298</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1299</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1300</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1301</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">int</span> executeStatement(String statementString, String dbName)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1302</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1303</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1304</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1305</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> rowCount = -1;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1306</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1307</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1308</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            con = Torque.getConnection(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1309</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            rowCount = executeStatement(statementString, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1310</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1311</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1312</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1313</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Torque.closeConnection(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1314</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1315</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> rowCount;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1316</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1317</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1318</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1319</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Utility method which executes a given sql statement.  This</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1320</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * method should be used for update, insert, and delete</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1321</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * statements.  Use executeQuery() for selects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1322</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1323</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param statementString A String with the sql statement to execute.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1324</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con A Connection.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1325</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return The number of rows affected.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1326</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1327</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1328</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1329</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">int</span> executeStatement(String statementString, Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1330</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1331</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1332</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> rowCount = -1;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1333</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Statement statement = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1334</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1335</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1336</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            statement = con.createStatement();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1337</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            rowCount = statement.executeUpdate(statementString);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1338</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1339</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1340</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1341</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1342</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1343</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1344</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1345</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (statement != <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1346</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1347</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1348</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1349</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    statement.close();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1350</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1351</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1352</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1353</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1354</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1355</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1356</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1357</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> rowCount;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1358</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1359</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1360</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1361</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If the user specified that (s)he only wants to retrieve a</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1362</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * single record and multiple records are retrieved, this method</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1363</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * is called to handle the situation.  The default behavior is to</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1364</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * throw an exception, but subclasses can override this method as</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1365</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * needed.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1366</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1367</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ds The DataSet which contains multiple records.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1368</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @exception TorqueException Couldn't handle multiple records.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1369</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1370</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> <span class="keyword">static</span> <span class="keyword">void</span> handleMultipleRecords(DataSet ds)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1371</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1372</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1373</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(<span class="string">"Criteria expected single Record and "</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1374</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                + <span class="string">"Multiple Records were selected"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1375</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1376</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1377</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1378</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * This method returns the MapBuilder specified in the name</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1379</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * parameter.  You should pass in the full path to the class, ie:</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1380</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * org.apache.torque.util.db.map.TurbineMapBuilder.  The</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1381</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * MapBuilder instances are cached in the TorqueInstance for speed.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1382</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1383</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param name name of the MapBuilder</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1384</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A MapBuilder, not null</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1385</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException if the Map Builder cannot be instantiated</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1386</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @deprecated Use Torque.getMapBuilder(name) instead</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1387</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1388</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> MapBuilder getMapBuilder(String name)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1389</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1390</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1391</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> Torque.getMapBuilder(name);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1392</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1393</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1394</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1395</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Performs a SQL &#60;code&#62;select&#60;/code&#62; using a PreparedStatement.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1396</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Note: this method does not handle null criteria values.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1397</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1398</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1399</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1400</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1401</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Error performing database query.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1402</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1403</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List doPSSelect(Criteria criteria, Connection con)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1404</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1405</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1406</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List v = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1407</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1408</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        StringBuffer qry = <span class="keyword">new</span> StringBuffer();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1409</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List params = <span class="keyword">new</span> ArrayList(criteria.size());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1410</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1411</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        createPreparedStatement(criteria, qry, params);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1412</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1413</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        PreparedStatement statement = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1414</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1415</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1416</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            statement = con.prepareStatement(qry.toString());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1417</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1418</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &#60; params.size(); i++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1419</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1420</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                Object param = params.get(i);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1421</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (param instanceof java.sql.Date)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1422</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1423</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    statement.setDate(i + 1, (java.sql.Date) param);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1424</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1425</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">else</span> <span class="keyword">if</span> (param instanceof NumberKey)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1426</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1427</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    statement.setBigDecimal(i + 1,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1428</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        ((NumberKey) param).getBigDecimal());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1429</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1430</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">else</span> <span class="keyword">if</span> (param instanceof Integer)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1431</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1432</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    statement.setInt(i + 1, ((Integer) param).intValue());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1433</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1434</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1435</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1436</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    statement.setString(i + 1, param.toString());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1437</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1438</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1439</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1440</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            QueryDataSet qds = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1441</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1442</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1443</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                qds = <span class="keyword">new</span> QueryDataSet(statement.executeQuery());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1444</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                v = getSelectResults(qds);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1445</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1446</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1447</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1448</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                VillageUtils.close(qds);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1449</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1450</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1451</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (DataSetException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1452</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1453</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1454</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1455</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1456</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1457</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throwTorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1458</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1459</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1460</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1461</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (statement != <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1462</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1463</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1464</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1465</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    statement.close();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1466</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1467</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">catch</span> (SQLException e)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1468</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1469</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">throw</span> <span class="keyword">new</span> TorqueException(e);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1470</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1471</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1472</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1473</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> v;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1474</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1475</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1476</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1477</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Do a Prepared Statement select according to the given criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1478</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1479</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1480</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a List of Record objects.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1481</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1482</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1483</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1484</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> List doPSSelect(Criteria criteria) throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1485</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1486</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Connection con = Torque.getConnection(criteria.getDbName());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1487</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List v = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1488</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1489</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1490</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1491</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            v = doPSSelect(criteria, con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1492</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1493</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1494</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1495</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Torque.closeConnection(con);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1496</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1497</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> v;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1498</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1499</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1500</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1501</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Create a new PreparedStatement.  It builds a string representation</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1502</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * of a query and a list of PreparedStatement parameters.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1503</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1504</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1505</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param queryString</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1506</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param params</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1507</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException Any exceptions caught during processing will be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1508</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         rethrown wrapped into a TorqueException.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1509</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1510</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> createPreparedStatement(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1511</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Criteria criteria,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1512</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        StringBuffer queryString,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1513</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        List params)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1514</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1515</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1516</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Query query = SQLBuilder.buildQueryClause(criteria, params, <span class="keyword">new</span> SQLBuilder.QueryCallback() {</pre></td>
    </tr>
    <tr>
      <td class="numLineCover">&nbsp;1517</td>
      <td class="nbHitsUncovered">&nbsp;0</td>
      <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">public</span> String process(Criteria.Criterion criterion, List params)</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1518</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLineCover">&nbsp;1519</td>
      <td class="nbHitsUncovered">&nbsp;0</td>
      <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    StringBuffer sb = <span class="keyword">new</span> StringBuffer();</span></pre></td>
    </tr>
    <tr>
      <td class="numLineCover">&nbsp;1520</td>
      <td class="nbHitsUncovered">&nbsp;0</td>
      <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    criterion.appendPsTo(sb, params);</span></pre></td>
    </tr>
    <tr>
      <td class="numLineCover">&nbsp;1521</td>
      <td class="nbHitsUncovered">&nbsp;0</td>
      <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">return</span> sb.toString();</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1522</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1523</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            });</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1524</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1525</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String sql = query.toString();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1526</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        log.debug(sql);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1527</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1528</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        queryString.append(sql);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1529</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1530</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1531</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1532</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Checks all columns in the criteria to see whether</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1533</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * booleanchar and booleanint columns are queried with a boolean.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1534</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * If yes, the query values are mapped onto values the database</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1535</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * does understand, i.e. 0 and 1 for booleanints and N and Y for</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1536</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * booleanchar columns.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1537</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1538</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criteria The criteria to be checked for booleanint and booleanchar</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1539</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *        columns.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1540</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param defaultTableMap the table map to be used if the table name is</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1541</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *        not given in a column.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1542</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws TorqueException if the database map for the criteria cannot be</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1543</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *         retrieved.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1544</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1545</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> correctBooleans(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1546</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Criteria criteria,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1547</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            TableMap defaultTableMap)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1548</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        throws TorqueException</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1549</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1550</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Iterator keyIt = criteria.keySet().iterator();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1551</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">while</span> (keyIt.hasNext())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1552</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1553</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            String key = (String) keyIt.next();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1554</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            String columnName;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1555</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            TableMap tableMap = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1556</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">int</span> dotPosition = key.lastIndexOf(<span class="string">"."</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1557</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (dotPosition == -1)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1558</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1559</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                columnName = key;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1560</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                tableMap = defaultTableMap;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1561</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1562</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1563</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1564</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                columnName = key.substring(dotPosition + 1);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1565</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                String tableName = key.substring(0, dotPosition);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1566</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                String databaseName = criteria.getDbName();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1567</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (databaseName == <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1568</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1569</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    databaseName = Torque.getDefaultDB();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1570</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1571</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                DatabaseMap databaseMap = Torque.getDatabaseMap(databaseName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1572</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (databaseMap != <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1573</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1574</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    tableMap = databaseMap.getTable(tableName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1575</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1576</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (tableMap == <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1577</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1578</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="comment">// try aliases</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1579</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    Map aliases = criteria.getAliases();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1580</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (aliases.get(tableName) != <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1581</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1582</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        tableName = (String) aliases.get(tableName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1583</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        tableMap = databaseMap.getTable(tableName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1584</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1585</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1586</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1587</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (tableMap == <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1588</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1589</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="comment">// no description of table available, do not modify anything</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1590</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">continue</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1591</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1592</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1593</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            ColumnMap columnMap = tableMap.getColumn(columnName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1594</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (columnMap != <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1595</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1596</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (<span class="string">"BOOLEANINT"</span>.equals(columnMap.getTorqueType()))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1597</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1598</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    Criteria.Criterion criterion = criteria.getCriterion(key);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1599</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    replaceBooleanValues(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1600</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            criterion,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1601</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            <span class="keyword">new</span> Integer(1),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1602</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            <span class="keyword">new</span> Integer(0));</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1603</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1604</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">else</span> <span class="keyword">if</span> (<span class="string">"BOOLEANCHAR"</span>.equals(columnMap.getTorqueType()))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1605</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1606</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    Criteria.Criterion criterion = criteria.getCriterion(key);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1607</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    replaceBooleanValues(criterion, <span class="string">"Y"</span>, <span class="string">"N"</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1608</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                 }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1609</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1610</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1611</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1612</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1613</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1614</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Replaces any Boolean value in the criterion and its attached Criterions</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1615</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * by trueValue if the Boolean equals &#60;code&#62;Boolean.TRUE&#60;/code&#62;</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1616</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * and falseValue if the Boolean equals &#60;code&#62;Boolean.FALSE&#60;/code&#62;.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1617</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1618</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param criterion the criterion to replace Boolean values in.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1619</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param trueValue the value by which Boolean.TRUE should be replaced.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1620</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param falseValue the value by which Boolean.FALSE should be replaced.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1621</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1622</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">void</span> replaceBooleanValues(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1623</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Criteria.Criterion criterion,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1624</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Object trueValue,</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1625</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Object falseValue)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1626</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1627</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// attachedCriterions also contains the criterion itself,</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1628</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// so no additional treatment is needed for the criterion itself.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1629</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        Criteria.Criterion[] attachedCriterions</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1630</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            = criterion.getAttachedCriterion();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1631</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &#60; attachedCriterions.length; ++i)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1632</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1633</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Object criterionValue</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1634</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    = attachedCriterions[i].getValue();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1635</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (criterionValue instanceof Boolean)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1636</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1637</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                Boolean booleanValue = (Boolean) criterionValue;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1638</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                attachedCriterions[i].setValue(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1639</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        Boolean.TRUE.equals(booleanValue)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1640</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                ? trueValue</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1641</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                : falseValue);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1642</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1643</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1644</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1645</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1646</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1647</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1648</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1649</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Process the result of a Table list generation.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1650</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * This runs the statements onto the list of tables and</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1651</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * provides a callback hook to add functionality.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1652</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1653</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * This method should've been in SQLBuilder, but is uses the handleMultipleRecords callback thingie..</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1654</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1655</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param crit The criteria</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1656</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param tables A set of Tables to run on</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1657</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param con The SQL Connection to run the statements on</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1658</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param pc A ProcessCallback object</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1659</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     *</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1660</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws Exception An Error occured (should be wrapped into TorqueException)</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1661</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1662</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">void</span> processTables(Criteria crit, Set tables, Connection con, ProcessCallback pc)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1663</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            throws Exception</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1664</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1665</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        String dbName = crit.getDbName();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1666</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        DB db = Torque.getDB(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1667</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        DatabaseMap dbMap = Torque.getDatabaseMap(dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1668</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1669</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="comment">// create the statements for the tables</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1670</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Iterator it = tables.iterator(); it.hasNext();)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1671</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1672</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            String table = (String) it.next();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1673</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            KeyDef kd = <span class="keyword">new</span> KeyDef();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1674</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            Set whereClause = <span class="keyword">new</span> HashSet();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1675</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1676</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            ColumnMap[] columnMaps = dbMap.getTable(table).getColumns();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1677</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1678</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (<span class="keyword">int</span> j = 0; j &#60; columnMaps.length; j++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1679</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1680</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                ColumnMap colMap = columnMaps[j];</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1681</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (colMap.isPrimaryKey())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1682</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1683</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    kd.addAttrib(colMap.getColumnName());</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1684</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1685</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1686</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                String key = <span class="keyword">new</span> StringBuffer(colMap.getTableName())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1687</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        .append('.')</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1688</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        .append(colMap.getColumnName())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1689</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        .toString();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1690</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1691</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (crit.containsKey(key))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1692</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1693</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (crit</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1694</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            .getComparison(key)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1695</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                            .equals(Criteria.CUSTOM))</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1696</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1697</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        whereClause.add(crit.getString(key));</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1698</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1699</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">else</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1700</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1701</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        whereClause.add(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1702</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                SqlExpression.build(</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1703</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                        colMap.getColumnName(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1704</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                        crit.getValue(key),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1705</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                        crit.getComparison(key),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1706</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                        crit.isIgnoreCase(),</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1707</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                                        db));</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1708</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1709</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1710</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1711</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1712</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="comment">// Execute the statement for each table</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1713</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            TableDataSet tds = <span class="keyword">null</span>;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1714</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1715</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1716</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                String tableName = SQLBuilder.getFullTableName(table, dbName);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1717</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1718</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="comment">// Get affected records.</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1719</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                tds = <span class="keyword">new</span> TableDataSet(con, tableName, kd);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1720</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                String sqlSnippet = StringUtils.join(whereClause.iterator(), <span class="string">" AND "</span>);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1721</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1722</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (log.isDebugEnabled())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1723</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1724</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    log.debug(<span class="string">"BasePeer: whereClause="</span> + sqlSnippet);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1725</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1726</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1727</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                tds.where(sqlSnippet);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1728</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                tds.fetchRecords();</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1729</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1730</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (tds.size() &#62; 1 &#38;&#38; crit.isSingleRecord())</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1731</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1732</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    handleMultipleRecords(tds);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1733</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1734</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1735</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                <span class="keyword">for</span> (<span class="keyword">int</span> j = 0; j &#60; tds.size(); j++)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1736</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1737</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    Record rec = tds.getRecord(j);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1738</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1739</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (pc != <span class="keyword">null</span>)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1740</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1741</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        <span class="comment">// Table name _without_ schema!</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1742</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                        pc.process(table, dbName, rec);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1743</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1744</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1745</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1746</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            <span class="keyword">finally</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1747</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1748</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                VillageUtils.close(tds);</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1749</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;            }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1750</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1751</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1752</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1753</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="comment">/*<span class="comment">*</span></span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1754</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * Inner Interface that defines the Callback method for</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1755</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     * the Record Processing</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1756</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1757</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> <span class="keyword">interface</span> ProcessCallback</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1758</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    {</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1759</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;        <span class="keyword">void</span> process (String table, String dbName, Record rec)</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1760</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;                throws Exception;</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1761</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;    }</pre></td>
    </tr>
    <tr>
      <td class="numLine">&nbsp;1762</td>
      <td class="nbHits">&nbsp;</td>
      <td class="src"><pre class="src">&nbsp;}</pre></td>
    </tr>
  </table>
<p><table cellpadding="0" cellspacing="0" class="report">  <tr class="report">    <td class="reportText"><span class="text">    This report is generated by <a href="http://www.jcoverage.com">jcoverage</a>, <a href="http://maven.apache.org">Maven</a> and <a href="http://maven.apache.org/reference/plugins/jcoverage/">Maven JCoverage Plugin</a>.    </span></td>  </tr></table>
</body>
</html>
